/**
 * 作者：陈文斌 on 2019/1/30.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';
import 'package:crm/view/Tile/tile_space_between.dart';
import 'package:crm/view/Tile/list_tile_text.dart';
import 'package:crm/view/GridView/grid_view_add_image.dart';
import 'package:crm/view/Button/enterButton.dart';
import 'package:crm/model/PainPoint/pain_point_model.dart';

class PainPointEditSection extends StatefulWidget {
  final PainPointModel painPoint;

  PainPointEditSection({
    Key key,
    this.painPoint,
  }) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return _PainPointEditSectionState();
  }
}

class _PainPointEditSectionState extends State<PainPointEditSection> {
  final TextStyle _textStyle = TextStyle(
    color: AppColors.DetailTextColor,
    fontSize: AppFontSizes.Font15,
    fontFamily: AppFontFamilies.PingFangSC,
    fontWeight: FontWeight.w500,
  );
  final TextStyle _hintStyle = TextStyle(
    color: AppColors.DetailTextColor,
    fontSize: AppFontSizes.Font13,
    fontFamily: AppFontFamilies.PingFangSC,
    fontWeight: FontWeight.w500,
  );

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        FocusScope.of(context).requestFocus(FocusNode());
      },
      child: ListView(
        children: <Widget>[
          PaddingSet.PaddingTop(10),
          ListTileText(
            title: Text('沟通客户', style: _textStyle),
            dividerVisible: true,
          ),
          PaddingSet.PaddingTop(10),
          ListTileText(
            title: Text('记录人', style: _textStyle),
            arrowVisible: true,
          ),
          ListTileText(
            title: Text('沟通时间', style: _textStyle),
            dividerVisible: true,
          ),
          TileSpaceBetween(
            title: Text('沟通记录', style: _textStyle),
            height: 42,
          ),
          Container(
            padding: EdgeInsets.fromLTRB(16, 13, 16, 13),
            color: Colors.white,
            child: Column(
              children: <Widget>[
                TextField(
                  decoration: InputDecoration(
                    hintText: '请输入…',
                    hintStyle: _hintStyle,
                    border: InputBorder.none,
                    contentPadding: EdgeInsets.zero,
                  ),
                  style: _textStyle,
                  maxLines: 5,
                ),
                GridViewAddImage(
                  contentPadding: EdgeInsets.zero,
                ),
              ],
            ),
          ),
          PaddingSet.PaddingTop(125),
          EnterButton(
            onPressed: () {
              print('保存');
            },
            text: '保存',
          ),
        ],
      ),
    );
  }
}
